//#include "main.h"
#include "../include/hash.h"
#include "../include/vfs_errorcodes.h"
struct node
{
   struct fileDescriptor *fddata;
   struct node *parent;
   struct node *lchild;
   struct node *rsibling;
};

//struct node *createRoot(struct node *);
struct node * narraymount(char fileSystemName[]);
struct node * createChild(char childName[],char locationPath[],struct node *);
struct node * createChildMount(struct fileDescriptor *fd,struct node *root1);
struct node * deleteChild(char locationPath[],struct node *root1);
void deleteChildfile(struct node *root1);
struct node * movedircall(char srclocationPath[], char destnlocationPath[], struct node *root1);
struct node * movefilecall(char srclocationPath[], char destnlocationPath[], struct node *root1);
struct node * insertChild(char childName[],char fType[],char locationPath[],struct node *,struct fileDescriptor *);

struct node *findfolder(struct node *,char location[]);
struct node * updatelocPath_subTree(struct node *temp1,char destnlocationPath[]);
struct node * findpreviousfolder(struct node *temp1,char location[]);
int printfolder(struct node *temp1);
int unmount_narry(char fileSystemName[],struct node *);
void writefd(char fileSystemName[],struct node *root);
void print(char f[]);
void reinitializefd(fsname);
int makedircall(char childName[],char locationPath[],struct node *root1);
struct node * findDirectory(struct node *temp1,char fileName[]);
struct node *root;
int listdir_new(char dir_path[], int flag, char outputfile[],struct node *root);
void write_to_file(struct node* temp_listdir, int flag, FILE * fp_out,char dir_path[]);
int traverse_listdir(struct node* temp_listdir1, FILE *fp_out);
int listfile_new(char filePath[],char filename_out[],char fileSystemName[],struct node* root);
int findfile(struct node* temp_listfile, FILE * f_out, char fileSystemName[],char filePath[],int rflag);
void write_to_file_content(FILE *fp, FILE* f_out,struct Block bd);
